<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/html">
<head profile="http://www.w3.org/2005/10/profile">
  <title>myTODO</title>
  <link rel="stylesheet" type="text/css" href="css/general.css">
  <link rel="stylesheet" type="text/css" href="css/login.css">
  <link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.18.custom.css">
  <link rel="icon" type="image/ico" href="images/favicon.ico">
  <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
  <script type="text/javascript" src="js/jquery.example.js"></script>
  <script type="text/javascript" src="js/jquery-ui-1.8.18.custom.js"></script>
  <script type="text/javascript" src="js/jquery.ui.core.js"></script>
  <script type="text/javascript" src="js/jquery.ui.dialog.js"></script>
  <script type="text/javascript" src="js/jquery.ui.position.js"></script>
  <script type="text/javascript" src="js/jquery.ui.widget.js"></script>
  <script type="text/javascript" src="js/jquery.url.decoder.js"></script>
  <script type="text/javascript" src="js/jquery.cookies.js"></script>
  <script type="text/javascript" src="js/login.js"></script>
</head>
<body>
  <div id="loginForm">
    <div id="loginData">
      <div id="welcomeText">
        Welcome to myTODO
      </div>
      <s:form id="login" action="login" method="POST">
        <input type="text" id="userName" name="username" class="userData"><br/>
        <input type="text" id="password" class="userData" onfocus="changeInputType({current: 'password', next: 'passwordField'});">
        <input type="password" id="passwordField" name="password" class="userData hide" onblur="changeInputType({current: 'passwordField', next: 'password'});">
        <span id="msgboxLogin"></span>
        <div id="loginControls">
          <input type="checkbox" id="stayLoggedIn"/> Keep me logged in.
          <input type="button" value="Log In" class="loginFormButton" onclick="logIn({userName: $('#userName').val(), password: $('#passwordField').val()})"/>
          <br/>
        </div>
      </s:form>
      <div id="registerControls">
        No account yet? <a href="javascript:void(0)" onclick="openRegistrationForm()" name="Sign up!">>> Sign up <<</a>
      </div>
    </div>
    <br/><s:actionmessage/>
  </div>
  <div id="regamine">
    <div id="registrationFormContainer">
      <s:form action="registerUser" id="registrationForm" method="POST">
        <s:actionerror/>
        <br/>

        <div>
          <div class="registrationRow">Please fill in this form:</div>
          <div class="registrationRow">
            <input type="text" id="registeredFirstName" name="registeredFirstName" class="registrationField">
            <span id="msgboxFirstName"></span>
            <br/>
          </div>
          <div class="registrationRow">
            <input type="text" id="registeredLastName" name="registeredLastName" class="registrationField">
            <span id="msgboxLastName"></span>
            <br/>
          </div>
          <div class="registrationRow">
            <input type="text" id="registeredUserName" name="registeredUserName" class="registrationField">
            <span id="msgboxUsername"></span>
            <br/>
          </div>
          <div class="registrationRow">
            <input type="text" id="registeredEmail" name="registeredEmail" class="registrationField">
            <span id="msgboxEmail"></span>
            <br/>
          </div>
          <div class="registrationRow">
            <input type="text" id="registeredPasswordFake" class="registrationField"
                   onfocus="changeInputType({current: 'registeredPasswordFake', next : 'registeredPassword'})">
            <input type="password" id="registeredPassword" name="registeredPassword" class="registrationField hide">
            <span id="msgboxPassword"></span>
            <br/>
          </div>
          <div class="registrationRow">
            <input type="text" id="registeredPasswordAgainFake" class="registrationField"
                   onfocus="changeInputType({current: 'registeredPasswordAgainFake', next : 'registeredPasswordAgain'})">
            <input type="password" id="registeredPasswordAgain" name="registeredPasswordAgain"
                   class="registrationField hide">
            <span id="msgboxPasswordAgain"></span>
            <br/>
          </div>
          <div class="registrationRow">
            <input type="button" value="REGISTER" id="registrationButton" onclick="saveUser()"/>
            <input type="hidden" id="okSign" value="&#x2713"/>
            <span id="msgboxRegister"></span>
          </div>
        </div>
      </s:form>
    </div>
  </div>
</body>
</html>